<?php

class Plugin_PlayerStats extends Zend_Controller_Plugin_Abstract{
	private $_playerStats = null;
	private $_user_id = null;	
	private $_result = null;
	
	public function __construct(Application_Model_PlayerStats $playerStats, $user_id)
	{
		$this->_user_id = $user_id;
		$this->_playerStats = $playerStats;
		$this->_result= $playerStats->getPlayerStats($user_id);
	}
	
	public function preDispatch(Zend_Controller_Request_Abstract $request)
	{
		$layout = Zend_Layout::getMvcInstance();
		$view = $layout->getView();
		$view->playerStats = $this->_result;
   }
	
}